Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Support ZST in mamba and enable ZST by default #2404

Merged
merged 26 commits into from
Jun 27, 2023

Conversation

johnhany97
Copy link
Contributor

@johnhany97 johnhany97 commented Mar 23, 2023

Before this PR

Only micromamba benefited from ZST support added in #2113

In addition, it was only enabled behind a flag, where users are required to add repodata_use_zst: true to their .condarc file.

After this PR

mamba benefits from ZST support as well, and users no longer need to manually enable the flag. From now on, zst repodatas will be used where they're available.

@@ -274,6 +277,7 @@ def get_base_url(url, name=None):
api_ctx.retry_backoff = context.remote_backoff_factor
api_ctx.add_pip_as_python_dependency = context.add_pip_as_python_dependency
api_ctx.use_only_tar_bz2 = context.use_only_tar_bz2
api_ctx.repodata_use_zst = True
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hard-coded all around to true, and I should obviously pass it along from the context.

What's your preference on the path forwards? Should i make repodata_use_zst configurable using an env var (a la MAMBA_REPODATA_USE_ZST), read that in here and set it accordingly?

@johnhany97
Copy link
Contributor Author

I built this locally and verified that I now hit the .zst repodatas:

image

@jonashaag
Copy link
Contributor

It seems like zstd support is pretty stable in Micromamba, do we just want to remove the repodata_use_zst option? @wolfv @AntoinePrv

@johnhany97
Copy link
Contributor Author

I'm happy to repurpose this PR to do so if y'all are onboard 👍

@JohanMabille
Copy link
Member

It seems like zstd support is pretty stable in Micromamba, do we just want to remove the repodata_use_zst option? @wolfv @AntoinePrv

I agree, we should use zstd everywhere and remove the option

@jonashaag
Copy link
Contributor

OK let's do it!

@jonashaag
Copy link
Contributor

Should fix this first #2418

@corneliusroemer
Copy link
Contributor

Thanks for tackling this @johnhany97 @jonashaag

#2418 should be fixed now

@jonashaag
Copy link
Contributor

@corneliusroemer do you want to complete this PR? Happy to merge when done

@johnhany97
Copy link
Contributor Author

I'm also happy to fix the broken test here. Can likely get to this later this week.

@johnhany97 johnhany97 changed the title Improvement: Support ZSTD in mamba Improvement: Support ZST in mamba May 14, 2023
@johnhany97
Copy link
Contributor Author

I've opened a separate PR to discuss the removal of the repodata_use_zst flag all together -> #2525

This PR for now assumes this flag is here to stay, and thus wires it up accordingly, if we end up merging the other PR first, then I can remove these flags in this PR.

@johnhany97 johnhany97 changed the title Improvement: Support ZST in mamba Improvement: Support ZST in mamba and enable ZST by default May 14, 2023
@johnhany97
Copy link
Contributor Author

Windows CI tasks seem to be failing with:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
D:/a/mamba/mamba/libmamba/WINREG_INCLUDE_DIR
   used as include directory in directory D:/a/mamba/mamba/libmamba

which I believe is not relevant to this PR, but i'm not sure how to fix.

@AntoinePrv
Copy link
Member

The Windows failure is unrelated and a fix is proposed in #2526.

Comment on lines +119 to +120
if info["needs_finalising"]:
sd.finalize_checks()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with this part of the code base, can you explain what is going on here? Are there any alternatives to having this logic here in Python?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively just me mimicking the code that's in channel_loader which atm is duplicated between mamba and micromamba.

Let me know if you have an idea in mind that I could test out to make this nicer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More concretely though, what's happening in the zst-enabled codepaths is that we do a HEAD request first to check if the zst variant exists, and if it does, we add another target that's the actual GET request for the zst variant.

@johnhany97
Copy link
Contributor Author

Looks like this is good to merge :D

@johnhany97
Copy link
Contributor Author

@JohanMabille should we proceed with merging this?

@jonashaag jonashaag merged commit 60cd358 into mamba-org:main Jun 27, 2023
@johnhany97 johnhany97 deleted the jayad/use-zst branch June 27, 2023 14:33
@johnhany97
Copy link
Contributor Author

Thank you @jonashaag 🚀

AntoinePrv added a commit to AntoinePrv/mamba that referenced this pull request Jun 28, 2023
@AntoinePrv AntoinePrv mentioned this pull request Jun 28, 2023
JohanMabille pushed a commit to AntoinePrv/mamba that referenced this pull request Jun 28, 2023
JohanMabille pushed a commit to AntoinePrv/mamba that referenced this pull request Jun 28, 2023
AntoinePrv added a commit that referenced this pull request Jun 29, 2023
* Revert "Change brace space in clang-format (#2627)"

This reverts commit 3dce990.

* Revert "Improvement: Support ZST in mamba and enable ZST by default (#2404)"

This reverts commit 60cd358.
@AntoinePrv
Copy link
Member

@johnhany97 @jonashaag this PR was reverted in #2637. I t was likely merged out of date with main and was the likely reason for the CI failing in main.

@jonashaag
Copy link
Contributor

Thanks for letting me know and sorry for the trouble. I should have rebased before merging because the PR was already pretty old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants